import type { AimType } from '@/utils/types'
import { computed, ref } from 'vue'

export const useAim = () => {
  const aim = ref<AimType>('detail')
  const setAim = (aimStr: AimType) => {
    aim.value = aimStr
  }
  const isEdit = computed(() => {
    return aim.value === 'edit'
  })

  const isDetail = computed(() => {
    return aim.value === 'detail'
  })
  return {
    aim,
    isEdit,
    isDetail,
    setAim
  }
}